# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Jan de Groot <jgc@archlinux.org>

pkgbase=pango
pkgname=(pango pango-docs)
pkgver=1.48.10
pkgrel=1
epoch=1
pkgdesc="A library for layout and rendering of text"
url="https://www.pango.org/"
arch=(x86_64)
license=(LGPL)
depends=(libthai cairo libxft harfbuzz fribidi)
makedepends=(gobject-introspection help2man git meson gi-docgen)
checkdepends=(ttf-dejavu cantarell-fonts noto-fonts noto-fonts-emoji)
_commit=dc5bde2a20cbb025c9d0ed29ed687740a4d027da  # tags/1.48.10^0
source=("git+https://gitlab.gnome.org/GNOME/pango.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd pango
  git describe --tags | sed 's/-/+/g'
}

prepare() {
  cd pango
}

build() {
  arch-meson pango build -D gtk_doc=true
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package_pango() {
  provides=(libpango{,cairo,ft2,xft}-1.0.so)

  meson install -C build --destdir "$pkgdir"

  mkdir -p doc/usr/share
  mv {"$pkgdir",doc}/usr/share/doc
}

package_pango-docs() {
  pkgdesc+=" (documentation)"
  depends=()

  mv doc/* "$pkgdir"
}

# vim:set sw=2 et:
